package rad.framework.mda.generator.template.main.webapp.webinf.classes;

import java.util.*;
import org.eclipse.uml2.uml.*;
import rad.framework.mda.generator.util.*;

public class Messages
{
  protected static String nl;
  public static synchronized Messages create(String lineSeparator)
  {
    nl = lineSeparator;
    Messages result = new Messages();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "";
  protected final String TEXT_2 = "_Menu=";
  protected final String TEXT_3 = NL;
  protected final String TEXT_4 = NL;
  protected final String TEXT_5 = "_Menu=";
  protected final String TEXT_6 = NL;
  protected final String TEXT_7 = NL;
  protected final String TEXT_8 = "_";
  protected final String TEXT_9 = "_label=";
  protected final String TEXT_10 = NL;
  protected final String TEXT_11 = "_";
  protected final String TEXT_12 = "_title=";
  protected final String TEXT_13 = NL;
  protected final String TEXT_14 = "_";
  protected final String TEXT_15 = "_";
  protected final String TEXT_16 = "_label=";
  protected final String TEXT_17 = NL;
  protected final String TEXT_18 = "_";
  protected final String TEXT_19 = "_";
  protected final String TEXT_20 = "_icon=";
  protected final String TEXT_21 = NL;
  protected final String TEXT_22 = "_";
  protected final String TEXT_23 = "_";
  protected final String TEXT_24 = "_title=";
  protected final String TEXT_25 = NL;
  protected final String TEXT_26 = NL;
  protected final String TEXT_27 = "_Menu=";
  protected final String TEXT_28 = NL;
  protected final String TEXT_29 = NL;
  protected final String TEXT_30 = "=";
  protected final String TEXT_31 = NL;
  protected final String TEXT_32 = "_Menu=";
  protected final String TEXT_33 = " Maintenance";
  protected final String TEXT_34 = NL;
  protected final String TEXT_35 = "ListReportTitle=";
  protected final String TEXT_36 = " List Report";
  protected final String TEXT_37 = NL;
  protected final String TEXT_38 = "DetailReportTitle=";
  protected final String TEXT_39 = " Report";
  protected final String TEXT_40 = NL;
  protected final String TEXT_41 = "Doc=";
  protected final String TEXT_42 = NL;
  protected final String TEXT_43 = NL;
  protected final String TEXT_44 = "_";
  protected final String TEXT_45 = "=";
  protected final String TEXT_46 = NL;
  protected final String TEXT_47 = "_";
  protected final String TEXT_48 = "Doc=";
  protected final String TEXT_49 = " - ";
  protected final String TEXT_50 = NL;
  protected final String TEXT_51 = NL;
  protected final String TEXT_52 = "Chart=By ";
  protected final String TEXT_53 = " ";
  protected final String TEXT_54 = NL + "    ";
  protected final String TEXT_55 = NL;
  protected final String TEXT_56 = "Chart=By ";
  protected final String TEXT_57 = " ";
  protected final String TEXT_58 = NL;
  protected final String TEXT_59 = NL;
  protected final String TEXT_60 = NL;
  protected final String TEXT_61 = "=";
  protected final String TEXT_62 = NL;
  protected final String TEXT_63 = NL;
  protected final String TEXT_64 = NL;
  protected final String TEXT_65 = "_";
  protected final String TEXT_66 = "=";
  protected final String TEXT_67 = NL;
  protected final String TEXT_68 = NL;
  protected final String TEXT_69 = NL;
  protected final String TEXT_70 = "MDB_";
  protected final String TEXT_71 = "_initiate_subject=#{task.name.concat(' - ').concat(task.description)}";
  protected final String TEXT_72 = NL;
  protected final String TEXT_73 = "MDB_";
  protected final String TEXT_74 = "_complete_subject=#{task.name.concat(' - ').concat(task.description)}";
  protected final String TEXT_75 = NL;
  protected final String TEXT_76 = "MDB_";
  protected final String TEXT_77 = "_subject=#{task.name.concat(' - ').concat(task.description)}";
  protected final String TEXT_78 = NL;
  protected final String TEXT_79 = NL;
  protected final String TEXT_80 = "MDB_";
  protected final String TEXT_81 = "_";
  protected final String TEXT_82 = "_label=";
  protected final String TEXT_83 = NL;
  protected final String TEXT_84 = "MDB_";
  protected final String TEXT_85 = "_";
  protected final String TEXT_86 = "_icon=";
  protected final String TEXT_87 = NL;
  protected final String TEXT_88 = "MDB_";
  protected final String TEXT_89 = "_";
  protected final String TEXT_90 = "_title=";
  protected final String TEXT_91 = NL + NL;
  protected final String TEXT_92 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    

    Model uml2Model = (Model) argument;
    stringBuffer.append(TEXT_1);
    stringBuffer.append(NameHelper.getCapName(uml2Model).replace("-","_"));
    stringBuffer.append(TEXT_2);
    stringBuffer.append(NameHelper.getCapName(uml2Model));
    stringBuffer.append(TEXT_3);
    for (Iterator<Region> i=JsfHelper.getPageflows(uml2Model); i.hasNext();) { Region region = (Region)i.next();
    stringBuffer.append(TEXT_4);
    stringBuffer.append(NameHelper.removeSpaces(region.getName()));
    stringBuffer.append(TEXT_5);
    stringBuffer.append(NameHelper.toDisplay(NameHelper.removeSpaces(region.getName())));
    for (Iterator<State> j=JsfHelper.getPages(region); j.hasNext();) { State state = (State)j.next();
    stringBuffer.append(TEXT_6);
    stringBuffer.append(TEXT_7);
    stringBuffer.append(NameHelper.removeSpaces(region.getName()));
    stringBuffer.append(TEXT_8);
    stringBuffer.append(NameHelper.removeSpaces(state.getName()));
    stringBuffer.append(TEXT_9);
    stringBuffer.append(NameHelper.toDisplay(NameHelper.removeSpaces(state.getName())));
    stringBuffer.append(TEXT_10);
    stringBuffer.append(NameHelper.removeSpaces(region.getName()));
    stringBuffer.append(TEXT_11);
    stringBuffer.append(NameHelper.removeSpaces(state.getName()));
    stringBuffer.append(TEXT_12);
    stringBuffer.append(TypeHelper.getDocumentation(state));
    for (Iterator<Transition> k=state.getOutgoings().iterator(); k.hasNext();) { Transition t = (Transition)k.next();
    stringBuffer.append(TEXT_13);
    stringBuffer.append(NameHelper.removeSpaces(region.getName()));
    stringBuffer.append(TEXT_14);
    stringBuffer.append(NameHelper.removeSpaces(state.getName()));
    stringBuffer.append(TEXT_15);
    stringBuffer.append(NameHelper.removeSpaces(NameHelper.uncapSafeName(t)));
    stringBuffer.append(TEXT_16);
    stringBuffer.append(NameHelper.toDisplay(t.getName()));
    stringBuffer.append(TEXT_17);
    stringBuffer.append(NameHelper.removeSpaces(region.getName()));
    stringBuffer.append(TEXT_18);
    stringBuffer.append(NameHelper.removeSpaces(state.getName()));
    stringBuffer.append(TEXT_19);
    stringBuffer.append(NameHelper.removeSpaces(NameHelper.uncapSafeName(t)));
    stringBuffer.append(TEXT_20);
    stringBuffer.append(NameHelper.toDisplay(t.getName()));
    stringBuffer.append(TEXT_21);
    stringBuffer.append(NameHelper.removeSpaces(region.getName()));
    stringBuffer.append(TEXT_22);
    stringBuffer.append(NameHelper.removeSpaces(state.getName()));
    stringBuffer.append(TEXT_23);
    stringBuffer.append(NameHelper.removeSpaces(NameHelper.uncapSafeName(t)));
    stringBuffer.append(TEXT_24);
    stringBuffer.append(TypeHelper.getDocumentation(t));
    }
    }
    }
    stringBuffer.append(TEXT_25);
    stringBuffer.append(TEXT_26);
    stringBuffer.append(NameHelper.getCapName(uml2Model));
    stringBuffer.append(TEXT_27);
    stringBuffer.append(NameHelper.getCapName(uml2Model));
    stringBuffer.append(TEXT_28);
    for (Iterator i=ClassHelper.getClasses(uml2Model).iterator(); i.hasNext();) { org.eclipse.uml2.uml.Class element = (org.eclipse.uml2.uml.Class)i.next();
    if (StereotypeHelper.isStereotypeApplied(element,"javax.persistence.Entity") || StereotypeHelper.isStereotypeApplied(element,"javax.persistence.Embeddable")) {
    stringBuffer.append(TEXT_29);
    stringBuffer.append(element.getName());
    stringBuffer.append(TEXT_30);
    stringBuffer.append(NameHelper.toDisplay(element.getName()));
    stringBuffer.append(TEXT_31);
    stringBuffer.append(element.getName());
    stringBuffer.append(TEXT_32);
    stringBuffer.append(NameHelper.toDisplay(element.getName()));
    stringBuffer.append(TEXT_33);
    stringBuffer.append(TEXT_34);
    stringBuffer.append(element.getName());
    stringBuffer.append(TEXT_35);
    stringBuffer.append(NameHelper.toDisplay(element.getName()));
    stringBuffer.append(TEXT_36);
    stringBuffer.append(TEXT_37);
    stringBuffer.append(element.getName());
    stringBuffer.append(TEXT_38);
    stringBuffer.append(NameHelper.toDisplay(element.getName()));
    stringBuffer.append(TEXT_39);
    stringBuffer.append(TEXT_40);
    stringBuffer.append(element.getName());
    stringBuffer.append(TEXT_41);
    stringBuffer.append(TypeHelper.getDocumentation(element));
    stringBuffer.append(TEXT_42);
    for (Iterator j=element.getAllAttributes().iterator(); j.hasNext();) { org.eclipse.uml2.uml.Property property = (org.eclipse.uml2.uml.Property)j.next();
    stringBuffer.append(TEXT_43);
    stringBuffer.append(element.getName());
    stringBuffer.append(TEXT_44);
    stringBuffer.append(property.getName());
    stringBuffer.append(TEXT_45);
    stringBuffer.append(NameHelper.toDisplay(property.getName()));
    stringBuffer.append(TEXT_46);
    stringBuffer.append(element.getName());
    stringBuffer.append(TEXT_47);
    stringBuffer.append(property.getName());
    stringBuffer.append(TEXT_48);
    stringBuffer.append(NameHelper.toDisplay(property.getName()));
    stringBuffer.append(TEXT_49);
    stringBuffer.append(TypeHelper.getDocumentation(property));
    }
    stringBuffer.append(TEXT_50);
    for (Iterator<Property> k=EnumerationHelper.getAllEnumerations(element); k.hasNext();) { Property property = k.next();
    stringBuffer.append(TEXT_51);
    stringBuffer.append(element.getName());
    stringBuffer.append(NameHelper.getCapName(property));
    stringBuffer.append(TEXT_52);
    stringBuffer.append(NameHelper.toDisplay(property.getName()));
    stringBuffer.append(TEXT_53);
    }
    stringBuffer.append(TEXT_54);
    for (Iterator<Property> l=ClassHelper.getAllManyToOneProperties(element); l.hasNext();) { Property property = l.next();
    stringBuffer.append(TEXT_55);
    stringBuffer.append(element.getName());
    stringBuffer.append(NameHelper.getCapName(property));
    stringBuffer.append(TEXT_56);
    stringBuffer.append(NameHelper.toDisplay(property.getName()));
    stringBuffer.append(TEXT_57);
    }
    stringBuffer.append(TEXT_58);
    }}
    stringBuffer.append(TEXT_59);
    for (Iterator<Actor> j=ClassHelper.getActors(uml2Model); j.hasNext();) { Actor actor = j.next();
    stringBuffer.append(TEXT_60);
    stringBuffer.append(NameHelper.getCapName(actor));
    stringBuffer.append(TEXT_61);
    stringBuffer.append(NameHelper.getCapName(actor));
    }
    stringBuffer.append(TEXT_62);
    for (Iterator i=EnumerationHelper.getAllEnumerations(uml2Model).iterator(); i.hasNext();) { org.eclipse.uml2.uml.Enumeration element = (org.eclipse.uml2.uml.Enumeration)i.next();
    stringBuffer.append(TEXT_63);
    for (Iterator j=EnumerationHelper.getUniqueValuedGenEnumLiterals(element).iterator(); j.hasNext();) { org.eclipse.uml2.uml.EnumerationLiteral literal = (org.eclipse.uml2.uml.EnumerationLiteral)j.next();
    stringBuffer.append(TEXT_64);
    stringBuffer.append(element.getName());
    stringBuffer.append(TEXT_65);
    stringBuffer.append(EnumerationHelper.getEnumLiteralID(literal));
    stringBuffer.append(TEXT_66);
    stringBuffer.append(literal.getName());
    }}
    stringBuffer.append(TEXT_67);
    for (Iterator i=DocumentationHelper.getActivities(uml2Model).iterator(); i.hasNext();) { Activity activity = (Activity)i.next();
    for (Iterator j=activity.getNodes().iterator(); j.hasNext();) { ActivityNode node = (ActivityNode)j.next();
    if (ActivityHelper.isTask(node)) {
    stringBuffer.append(TEXT_68);
    stringBuffer.append(TEXT_69);
    stringBuffer.append(activity.getName());
    stringBuffer.append(TEXT_70);
    stringBuffer.append(NameHelper.removeSpaces(node.getName()));
    stringBuffer.append(TEXT_71);
    stringBuffer.append(TEXT_72);
    stringBuffer.append(activity.getName());
    stringBuffer.append(TEXT_73);
    stringBuffer.append(NameHelper.removeSpaces(node.getName()));
    stringBuffer.append(TEXT_74);
    stringBuffer.append(TEXT_75);
    stringBuffer.append(activity.getName());
    stringBuffer.append(TEXT_76);
    stringBuffer.append(NameHelper.removeSpaces(node.getName()));
    stringBuffer.append(TEXT_77);
    for (Iterator<ActivityEdge> k=node.getOutgoings().iterator(); k.hasNext();) { ActivityEdge outcome = k.next();
    if (!outcome.getName().toLowerCase().equals("timeout")) {
    stringBuffer.append(TEXT_78);
    stringBuffer.append(TEXT_79);
    stringBuffer.append(activity.getName());
    stringBuffer.append(TEXT_80);
    stringBuffer.append(NameHelper.removeSpaces(node.getName()));
    stringBuffer.append(TEXT_81);
    stringBuffer.append(outcome.getName());
    stringBuffer.append(TEXT_82);
    stringBuffer.append(outcome.getName());
    stringBuffer.append(TEXT_83);
    stringBuffer.append(activity.getName());
    stringBuffer.append(TEXT_84);
    stringBuffer.append(NameHelper.removeSpaces(node.getName()));
    stringBuffer.append(TEXT_85);
    stringBuffer.append(outcome.getName());
    stringBuffer.append(TEXT_86);
    stringBuffer.append(outcome.getName());
    stringBuffer.append(TEXT_87);
    stringBuffer.append(activity.getName());
    stringBuffer.append(TEXT_88);
    stringBuffer.append(NameHelper.removeSpaces(node.getName()));
    stringBuffer.append(TEXT_89);
    stringBuffer.append(outcome.getName());
    stringBuffer.append(TEXT_90);
    stringBuffer.append(outcome.getName());
    }}}}}
    stringBuffer.append(TEXT_91);
    stringBuffer.append(TEXT_92);
    return stringBuffer.toString();
  }
}
